package cn.xabad.server.thea.task

import cn.xabad.server.thea.http.AppLogService
import feign.Feign
import feign.gson.GsonDecoder
import feign.gson.GsonEncoder
import org.springframework.context.annotation.Configuration
import org.springframework.scheduling.annotation.EnableScheduling
import org.springframework.stereotype.Component

@Configuration
@Component
@EnableScheduling // 该注解必须要加
class ScheduleTask {
    val monitorService = Feign.builder().encoder(GsonEncoder()).decoder(GsonDecoder())
            .requestInterceptor {
                println(it.url())
            }
            .target(AppLogService::class.java, "http://monitor.boxfish.cn")

    fun scheduleTest() {
        monitorService?.reloadDevice()
    }
}